<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link href='/pintuan/Public/Member/css/global.css' rel='stylesheet' type='text/css' />
<link href='/pintuan/Public/Member/css/main.css' rel='stylesheet' type='text/css' />

<script type='text/javascript' src='/pintuan/Public/Member/js/jquery-1.7.2.min.js'></script>
<script type='text/javascript' src='/pintuan/Public/Member/js/global.js'></script>
<link href='/pintuan/Public/Member/css/wechat.css' rel='stylesheet' type='text/css' />
<!--[if lte IE 9]><script src="__PUBIC__/Member/js/jquery.watermark-1.3.js"></script><![endif]-->
<script type='text/javascript' src='/pintuan/Public/Member/js/wechat.js'></script>
<script type='text/javascript'>
var web_domain='/pintuan';
var static_domain='/pintuan';
var img_domain='/pintuan';
var _PUBLIC_ = '/pintuan/Public';
var _FILE_ = '<?php echo U('Index/ajaxFileUpload');?>';
var domain={
        www:'<?php echo C('WEB_ABSOLUTE_URL');?>',
        static:'<?php echo C('WEB_ABSOLUTE_URL');?>',
        img:'<?php echo C('WEB_ABSOLUTE_URL');?>',
        file:'<?php echo C('WEB_ABSOLUTE_URL');?>',
        kf:'<?php echo C('WEB_ABSOLUTE_URL');?>'
};
</script>

</head>

<body>
	
	
	<div id="iframe_page">
		<div class="iframe_content">
			<div class="r_nav">
				<ul>
					<li class="<?php if((ACTION_NAME) == "index"): ?>cur<?php endif; ?>"><a href="<?php echo U('Wechat/index');?>">首次关注设置</a></li>
					<li class="<?php if((ACTION_NAME) == "classify"): ?>cur<?php endif; ?>"><a href="<?php echo U('Wechat/classify');?>">自定义菜单设置</a></li>
					<li class="<?php if((ACTION_NAME) == "keyword"): ?>cur<?php endif; ?>"><a href="<?php echo U('Wechat/keyword');?>">关键词回复</a></li>
					<li class="<?php if((ACTION_NAME) == "token"): ?>cur<?php endif; ?>"><a href="<?php echo U('Wechat/token');?>">微信接口配置</a></li>
					<li class="<?php if((ACTION_NAME) == "auth"): ?>cur<?php endif; ?>"><a href="<?php echo U('Wechat/auth');?>">微信授权配置</a></li>
					<li class="<?php if((ACTION_NAME) == "pay"): ?>cur<?php endif; ?>"><a href="<?php echo U('Wechat/pay');?>">运费&支付管理</a></li>
				</ul>
			</div>

		
		

			

<div id="wechat_menu" class="r_con_wrap">
    <script type='text/javascript' src='/pintuan/Public/Member/js/plugin/dragsort/dragsort-0.5.1.min.js'></script>
    <script language="javascript">$(document).ready(wechat_obj.menu_init);</script>
    <div class="m_menu">
        <div class="tips_info">
            1. 您的公众平台帐号类型必须升级为<span>服务号</span>。<br />
            2. 升级为服务号后，必须在微信公众平台申请接口使用的<span>AppId</span>和<span>AppSecret</span>，然后在【<a href="<?php echo U('wechat/auth');?>">微信授权配置</a>】中设置。<br />
            3. 最多创建<span>3</span>个一级菜单，每个一级菜单下最多可以创建<span>5</span>个二级菜单，菜单最多支持两层。<br />
            4. 拖动树形菜单可以对菜单重排序，但最终只有“<span>发布菜单</span>”后才会生效，公众平台限制了每天的发布次数，请勿频繁操作。<br />
            5. 微信公众平台规定，<span>菜单发布24小时后生效</span>。您也可先取消关注，再重新关注即可马上看到菜单。<br />
            6. 点击“<span>删除菜单</span>”操作只删除微信公众平台上的菜单，并不是删除本系统已经设置好的菜单。
        </div>
        <div class="form">
            <div class="m_lefter">
                <dl>
                <?php if(is_array($menu)): foreach($menu as $key=>$v): ?><dd MId="<?php echo ($v['id']); ?>">
                            <div class="list ">
                                <a href="<?php echo U('classify',array('id'=>$v['id']));?>" title="修改"><img src="/pintuan/Public/Member/images/ico/mod.gif" align="absmiddle" /></a>
                                <a href="<?php echo U('delClassify',array('id'=>$v['id']));?>" title="删除" onClick="if(!confirm('删除后不可恢复，继续吗？')){return false};"><img src="/pintuan/Public/Member/images/ico/del.gif" align="absmiddle" /></a>
                                <?php echo ($v['title']); ?>                       </div>
                              <ul>
                              <?php if(is_array($v["_child"])): foreach($v["_child"] as $key=>$vv): ?><li MId="<?php echo ($vv['id']); ?>">
                                         <div class="title"><img src="/pintuan/Public/Member/images/ico/jt.gif" /><?php echo ($vv['title']); ?> </div>
                                            <div class="opt">
                                                <a href="<?php echo U('classify',array('id'=>$vv['id']));?>"><img src="/pintuan/Public/Member/images/ico/mod.gif" /></a>
                                                <a href="<?php echo U('delClassify',array('id'=>$vv['id']));?>" onClick="if(!confirm('删除后不可恢复，继续吗？')){return false};"><img src="/pintuan/Public/Member/images/ico/del.gif" /></a>
                                            </div>
                                    </li><?php endforeach; endif; ?>
                              </ul>
                         <div class="blank9"></div>
                    </dd><?php endforeach; endif; ?>
                </dl>
                <div class="publish">
                    <input type="button" class="btn_green" url="<?php echo U('Wechat/publishClassify');?>" name="publish_btn" value="发布菜单">
                    <input type="button" class="btn_gray" url="<?php echo U('Wechat/delPublishedClassify');?>" name="del_btn" value="删除菜单">
                </div>
            </div>
            <div class="m_righter">
                <form id="wechat_menu_form" class="" action="" method="post">
                    <h1><?php if(($update) == "1"): ?>更新菜单<?php else: ?>添加菜单<?php endif; ?></h1>
                    <div class="opt_item">
                        <label>菜单名称：</label>
                        <span class="input"><input type="text" name="title" value="<?php echo ($menuInfo["title"]); ?>" class="form_input" size="15" maxlength="15" notnull /> <font class="fc_red">*</font></span>
                        <div class="clear"></div>
                    </div>
                                            <div class="opt_item">
                            <label>添加到：</label>
                            <span class="input">
	                            <select name="pid">
	                                <option value="0">一级菜单</option>
	                                 <?php if(is_array($parentMenu)): foreach($parentMenu as $key=>$v): ?><option value="<?php echo ($v["id"]); ?>" <?php if(($menuInfo["pid"]) == $v["id"]): ?>selected="selected"<?php endif; ?>><?php echo ($v["title"]); ?></option><?php endforeach; endif; ?>
	                            </select>
	                        </span>
                            <div class="clear"></div>
                        </div>
                                        <div class="opt_item">
                        <label>消息类型：</label>
                        <span class="input"><select name="MsgType">
                            <option value="0" <?php if(($menuInfo['config']['msgtype']) == "text"): ?>selected<?php endif; ?>>文字消息</option>
                            <option value="1" <?php if(($menuInfo['config']['msgtype'] == 'text' ) OR ($menuInfo['config']['msgtype'] == 'url') ): else: ?>selected<?php endif; ?>>图文消息</option>
                            <option value="2" <?php if(($menuInfo['config']['msgtype']) == "url"): ?>selected<?php endif; ?>>连接网址</option>
                        </select></span>
                        <div class="clear"></div>
                    </div>
                    <div class="opt_item" id="text_msg_row">
                        <label>文字内容：</label>
                        <span class="input"><textarea name="text"><?php echo ($menuInfo["config"]["textmsg"]["text"]); ?></textarea></span>
                        <div class="clear"></div>
                    </div>
                    <div class="opt_item" id="img_msg_row">
                        <label>图文内容：</label>
                        <span class="input">
                            <select name='MaterialId'>
                                <option value=''>--请选择--</option>
                                <!-- <optgroup label='---------------系统业务模块---------------'></optgroup>
                                <?php if(is_array($moudles_news["modules"])): foreach($moudles_news["modules"] as $key=>$v): ?><option value='<?php echo ($v["name"]); ?>' <?php if(($menuInfo["config"]["msgtype"]) == $v["name"]): ?>selected<?php endif; ?> ><?php echo ($v["title"]); ?></option><?php endforeach; endif; ?> -->
                                <optgroup label='---------------图文消息---------------'></optgroup>
                                <?php if(is_array($moudles_news["newsmsgs"])): foreach($moudles_news["newsmsgs"] as $key=>$v): ?><option value='<?php echo ($v["id"]); ?>' <?php if(($menuInfo["config"]["msgid"]) == $v["id"]): ?>selected="selected"<?php endif; ?>>【<?php if(($v["msgtype"]) == "onenews"): ?>单图文<?php else: ?>多图文<?php endif; ?>】<?php echo ($v["title"]); ?></option><?php endforeach; endif; ?>
                            </select><a href="<?php echo U('Material/index');?>">素材管理</a></span>
                        <div class="clear"></div>
                    </div>
                    <div class="opt_item" id="url_msg_row">
                        <label>链接网址：</label>
                        <span class="input"><input type="text" name="url" value="<?php echo ($menuInfo["config"]["url"]); ?>" class="form_input" size="35" maxlength="200" /></span>
                        <div class="clear"></div>
                    </div>
                    <div class="opt_item">
                        <label></label>
                        <span class="input"><input type="submit" class="btn_green btn_w_120" name="submit_button" value="添加菜单" /></span>
                        <div class="clear"></div>
                    </div>
                    <input type="hidden" name="id" value="<?php echo ($menuInfo["id"]); ?>">
                    <input type="hidden" name="sort" value="<?php echo ($menuInfo["sort"]); ?>">
                </form>
            </div>
            <div class="clear"></div>
        </div>
    </div>
</div>  


			
			</div>
			</div>
</body>
</html>